<template>
  <div>
    <ul>
      <router-link to="/" exact tag="li">/</router-link>
      <router-link to="/project" tag="li">
        我的项目
      </router-link>
      <router-link to="/workbench" tag="li">
        工作台
      </router-link>
      <router-link to="/doc" tag="li">
        文档
      </router-link>
    </ul>
    <div v-show="isLogin">
      <span @click="loginOut">退出</span>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Header',
  data () {
    return {
      isLogin: false
    }
  },
  created () {
    const info = this.$local.fetch('I CAN')
    this.isLogin = info.login
  },
  methods: {
    loginOut () {
      this.$local.save('I CAN', null)
      this.$router.push('/login')
    }
  }
}
</script>
